unit AmyChromium.Visitor;

interface

  uses ceflib
  , Amy.Chromium.Classes
  ;

type

  TElementNameVisitor = class(TCefDomVisitorOwn)
  private

  protected
    procedure visit(const doc: ICefDomDocument); override;
  public

  end;

implementation

  uses Amy.Chromium.Core;

{ TElementNameVisitor }

procedure TElementNameVisitor.visit(const doc: ICefDomDocument);
  procedure ProcessNode(ANode: ICefDomNode);
  var
    Node: ICefDomNode;
  begin
//    Logger.Debug('  ==> Node.Name: ' + ANode.Name + ' Node.TagName' + ANode.ElementTagName);
    if Assigned(ANode) then
    begin
      Node := ANode.FirstChild;
      while Assigned(Node) do
      begin
        Logger.Debug('  ==> Node.Name: ' + Node.Name + ' Node.TagName: ' + Node.ElementTagName);
        ProcessNode(Node);
        Node := Node.NextSibling;
      end;
    end;
  end;

  procedure CreateNode(Body: ICefDomNode);
  begin
//    Body.
  end;
begin
  Logger.Debug('==> TElementNameVisitor.Create start...');
//  doc.Document.
  ProcessNode(doc.Document);
  CreateNode(doc.Body);
  Logger.Debug('==> TElementNameVisitor.Create over....');
end;

end.
